package com.gxa.zhonglong.controller;

import com.gxa.zhonglong.common.JsonResult;
import com.gxa.zhonglong.mapper.StoneMapper;
import com.gxa.zhonglong.pojo.GoodsList;
import com.gxa.zhonglong.service.GoodsListService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author NITRO
 */

@Api
@CrossOrigin
@RestController
@RequestMapping("/goodsList")
public class GoodsListController {


    @Autowired
    private GoodsListService goodsListService;

    @ApiOperation(value = "返回商品名称(下拉框需要的数据)")
    @PostMapping("/getGoodsListNameList")
    public Map getGoodsListNameList() {
        List<GoodsList> goodsListName = goodsListService.getGoodsListName();
        JsonResult jsonResult = new JsonResult();
        jsonResult.setData(goodsListName);
        jsonResult.setCode("1");
        return jsonResult.getDataMap();
    }
}
